Release 10.1A: OpenEdge Getting Started:
Progress OpenEdge Studio


Dynamic Buffer/Temp Table module

The Progress 4GL puts the records that it reads into a buffer. Once a record is in the buffer, its fields are available to your application. While you can assign a static temp table for that buffer at compile time, you could not then change it at run time. For greater flexibility, the Progress 4GL enables you to build dynamic buffers. With a dynamic buffer, you can select the table for your buffer at run time. The buffer fields enable you to select the fields to be displayed.

To launch this module, choose the Dynamic Buffer/Temp Table button on the SportsPro main window. The Dynamic Buffer dialog box appears:

This module demonstrates a non-SmartObject approach to separating the user interface and business logic portions of an application. The initializeObject procedure runs a procedure on the AppServer partition that populates the list of database tables. Choosing the Open Query button runs another procedure on the AppServer partition. That procedure populates a dynamic temp table and passes back the handle for that temp table.

Table 2–4 describes the major objects used in the Dynamic Buffer/Temp Table module.

Table 2–4: Components of the Dynamic Buffer/Temp Table module
Object or filename
Object type
Function
wquery.w
SmartWindow
Serves as a container for the other objects in the module.
gettablefields.p
Procedure file
Runs during the initializeObject internal procedure to populate the selecttable selection list.
selecttable
Selection-list
Lists the available tables.
getnewfields.p
Procedure file
Runs when a table is selected to populate the selectfld selection list.
selectfld
Selection-list
Lists the available fields in the selected table.
btnadd
Button
Adds the field selected in the selectfld selection list to the selectfld2 selection list through the additem internal procedure.
btnremove
Button
Removes the selected field from the selectfld2 selection list through the removeitem internal procedure.
selectfld2
Selection-list
Lists the fields that will be displayed when the query runs.
btnopenqry
Button
Runs getrecords.p and receives the handle of the dynamic temp-table that procedure creates. It then runs the displayflds internal procedure to populate EDITOR–1.
getrecords.p
Procedure file
Creates a dynamic temp-table and populates it based on the fields listed in the selectfld2 selection list.
EDITOR–1
Editor
Displays a single record from the dynamic temp-table.
btnfirst
Button
Navigates to the first row of the result set.
btnnext
Button
Navigates to the next row of the result set.
btnprev
Button
Navigates to the previous row of the result set.
btnlast
Button
Navigates to the last row of the result set.

For more information on building dynamic buffers and temp tables, see the chapters on using dynamic buffers and on using temp tables in the OpenEdge Development: Progress 4GL Handbook .


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095